package com.tpsix.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.tpsix.annotation.Desensitization;
import com.tpsix.enums.SensitiveTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "sys_user")
public class SysUser implements Serializable {

    private static final long serialVersionUID = 6984142146365509406L;

    /**
     * id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 用户名
     */
    @TableField(value = "username")
    private String username;

    /**
     * 手机号
     */
    @TableField(value = "mobile")
    @Desensitization(SensitiveTypeEnum.MOBILE)
    private Long mobile;

    /**
     * 邮箱
     */
    @TableField(value = "email")
    @Desensitization(SensitiveTypeEnum.EMAIL)
    private String email;

    /**
     * 密码
     */
    @TableField(value = "password")
    @Desensitization(SensitiveTypeEnum.PASSWORD)
    private String password;

    /**
     * 头像
     */
    @TableField(value = "avatar")
    private String avatar;

    /**
     * 是否锁定
     */
    @TableField(value = "locked")
    private boolean locked;

    /**
     * 租户id
     */
    @TableField(value = "tenant_id")
    private Long tenantId;

    @TableField(value = "dept_id")
    private Integer deptId;

    @TableField(value = "created")
    private LocalDateTime created;

    @TableField(value = "deleted")
    @TableLogic
    private boolean deleted;

    @TableField(exist = false)
    private List<SysRole> roleList;

    /**
     * 部门名称
     */
    @TableField(exist = false)
    private String deptName;

}